import * as React from "react";
import AutosizeInput from "react-input-autosize";
import "./index.scss";

export default props => {
  const [ val, change ] = React.useState("       ");
  const { node } = props;
  const labelText = node.data.label;
  const { placeholder } = node.data;
  return (
    <div className="formitem">
      <label>{labelText || "用户名"}</label>
      <AutosizeInput
        style={{ minWidth: "5vw" }}
        value={val}
        onChange={e => change(e.target.value)}
        placeholder={placeholder}
      />
    </div>
  );
};
